//
//  HMBaseViewController.swift
//  SecondWB
//
//  Created by 赖建伟 on 16/11/25.
//  Copyright © 2016年 Itheima. All rights reserved.
//

import UIKit

class HMBaseViewController: UITableViewController ,HMVisitorViewDelegate{
    
    var visitorView = HMVisitorView()
    
    var isRegisted: Bool = false
    
    //MARK: - 生命周期
    override func loadView() {
        
        isRegisted == true ? (super.loadView()):(setupVisitorView())
        
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
//        view.backgroundColor = UIColor.red
        // Do any additional setup after loading the view.
    }

    private func setupVisitorView() {
        
        visitorView.delegate = self
        
        view = visitorView
        
    }
    
    //MARK: 实现HMVisitorViewDelegate
    func registButtonDidClick() {
        let visitorVc = HMVistorViewController()
        
        let nvc = UINavigationController(rootViewController: visitorVc)
        
        present(nvc, animated: true, completion: nil)
        
    }
    
    func loginButtonDidClick() {
        
    }

}
